<template>
  <div>
    <table cellspacing="0" border="1" style="border-collapse:collapse;">
      <!-- 定义100列 该行必须要有，相当于标尺 -->
      <tr class="noTd">
        <td v-for="item in num" :key="item"></td>
      </tr>
      <slot></slot>
    </table>
  </div>
</template>

<script>
export default {
  /* 
  ** 参数说明：
          num：将 table 平分为几等份，默认平分为 100 份
  */
  props: {
    num: { type: Number, default: 100 },
  },
};
</script>

<style lang="css" scoped>
table {
  width: 100%;
  text-align: center;
  font-size: 12px;
}
td {
  width: 1%;
  
}
.noTd {
  visibility: hidden;
}
/* 修改checkbox样式 */
input[type="checkbox"] {
  width: 13px;
  height: 13px;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  line-height: 13px;
  margin: 3px;
  margin-top: -2px;
  position: relative;
}
input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  background: #fff;
  width: 100%;
  height: 100%;
  border: 1px solid #000;
}
input[type="checkbox"]:checked::before {
  content: "\2714";
  background-color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border: 1px solid #000;
  color: #000;
  font-size: 12px;
  font-weight: bold;
}
</style>